body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  color: #fff;
  text-align: center;
  background: url("images/bg_space.jpg") no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  user-select: none;
}

/* Instruction Overlay */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10;
}

.instruction-box {
  background: rgba(10, 20, 40, 0.95);
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(0, 191, 255, 0.6);
  max-width: 450px;
  text-align: left;
  border: 2px solid cyan;
}

button {
  padding: 12px 24px;
  background: linear-gradient(135deg, #00bfff, #0099cc);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
  transition: 0.3s;
}

button:hover {
  background: linear-gradient(135deg, #0099cc, #007aa3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 191, 255, 0.6);
}

.hidden {
  display: none;
}

/* Timeline Game */
h1 {
  color: #00bfff;
  text-shadow: 0 0 20px rgba(0, 191, 255, 0.8);
}

#timeline {
  position: relative;
  width: 90%;
  max-width: 900px;
  margin: 40px auto;
  height: 90px;
  border-radius: 50px;
  background: rgba(0, 0, 30, 0.6);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#dropZones {
  display: flex;
  justify-content: space-evenly;
  width: 100%;
  z-index: 2;
}

.dropZone {
  width: 90px;
  height: 55px;
  border: 2px dashed cyan;
  border-radius: 10px;
  text-align: center;
  line-height: 55px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.4);
  color: white;
}

/* Comet Animation */
#comet {
  position: absolute;
  left: 0;
  top: 0;
  width: 70px;
  height: 100%;
  background: radial-gradient(circle at 40% 50%, rgba(255,255,120,1) 0%, rgba(255,255,0,0.5) 70%, transparent 100%);
  border-radius: 50%;
  box-shadow: 0 0 50px 15px rgba(255, 255, 120, 0.8);
  pointer-events: none;
  z-index: 1;
  transform: translateX(0);
}

@keyframes cometRace {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100% - 70px)); }
}

/* Cards */
#cardContainer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  max-width: 900px;
  margin: 20px auto;
}

.card {
  width: 170px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid cyan;
  cursor: grab;
  font-weight: bold;
  transition: 0.2s;
}

.card:active {
  transform: scale(1.05);
}

/* Controls */
#controls {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

#timer, #scoreBox {
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 20px;
  border-radius: 10px;
  border: 2px solid cyan;
  font-weight: bold;
}

/* Quiz Styling */
.quiz-header {
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
  border-radius: 15px;
  border: 2px solid cyan;
  margin-bottom: 30px;
}

#questionContainer .question-card {
  background: rgba(10, 20, 40, 0.9);
  padding: 30px;
  border-radius: 20px;
  border: 2px solid cyan;
}

.question-text {
  font-size: 20px;
  color: #ffcc00;
  font-weight: bold;
  margin-bottom: 20px;
}

.answer-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.answer-btn {
  padding: 15px 40px;
  font-size: 18px;
  min-width: 120px;
}

.correct {
  background: linear-gradient(135deg, #00ff00, #00cc00) !important;
  border: 2px solid lime !important;
}

.incorrect {
  background: linear-gradient(135deg, #ff0000, #cc0000) !important;
  border: 2px solid red !important;
}

/* Final Score */
#finalScoreCard {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.95);
  padding: 40px 50px;
  border-radius: 25px;
  box-shadow: 0 0 50px cyan;
  border: 3px solid cyan;
}

.score-breakdown {
  text-align: left;
  margin: 20px 0;
}

.score-row, .total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin: 10px 0;
}

.total span {
  color: gold;
}

#finalMessage {
  font-size: 20px;
  color: #ffcc00;
  margin: 15px 0;
}
