body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f8f9fa;
  margin: 0;
  padding: 20px;
  text-align: center;
  position: relative; /* Added for future flexibility */
}

.container {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 10px;
  display: inline-block;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  max-width: 600px;
  position: relative;
  z-index: 2;
}

.instructions {
  background-color: #fffbe6;
  padding: 10px;
  border: 1px solid #ffe58f;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: left;
}

.section {
  margin-bottom: 20px;
}

.color-container {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.color-box {
  width: 30px;
  height: 30px;
  position: relative;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border 0.2s ease, box-shadow 0.2s ease; /* Smooth border transitions */
}

.color-box.selected {
  border: 2px solid #000;
}

.color-box.correct {
  border: 2px solid #4CAF50; /* Brighter green border */
  box-shadow: 0 0 5px #4CAF50;
}

.box-label {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 10px;
  color: white;
  font-weight: bold;
}

.color-box.correct::after {
  content: "✅";
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
}

#submit-btn, .play-again-btn {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 16px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 10px; /* spacing between buttons */
}

#submit-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#submit-btn:hover:not(:disabled),
.play-again-btn:hover {
  background-color: #45a049; /* Slightly darker green on hover */
}

#submit-btn:focus:not(:disabled),
.play-again-btn:focus {
  outline: 2px solid #2e7d32; /* Clear focus ring */
  outline-offset: 2px;
}

#target-color {
  width: 100px;
  height: 50px;
  margin: 10px auto;
  border: 2px solid #000;
}

.guess-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
  text-align: left;
  justify-content: flex-start;
}

.guess-color {
  width: 40px;
  height: 40px;
  border: 2px solid #000;
  flex-shrink: 0;
}

canvas#confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

#result {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px; /* space between text and buttons */
  flex-wrap: wrap;
}

/* Mobile responsiveness (optional) */
@media (max-width: 480px) {
  .color-box {
    width: 24px;
    height: 24px;
  }

  .box-label {
    font-size: 8px;
  }

  #submit-btn, .play-again-btn {
    font-size: 14px;
    padding: 8px 16px;
  }
}

