* {
  margin: 0;
  padding: 0;
  user-select: none;
  /* overflow: hidden; */
}

main {
  height: 100%;
  position: absolute;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas {
  height: 99%;
  width: 98%;
  color: rgb(211, 135, 36);
  border: 1px solid black;
  color: rgb(89, 12, 133);
  box-shadow: 0 1.5px 5px 1px rgb(89, 12, 133);
  /* background: url("./img/happy.png"); */
  /* background-size: 22.5%; */
}

.control-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  pointer-events: auto;
  padding-top: 60px; /* leave room for score and sound button */
  background: rgba(255, 255, 255, 0.1); /* optional translucent background */
}

.control-panel .sound-container {
  margin-bottom: 10px;
}

.control-panel .difficulty-container {
  display: flex;
  gap: 10px;
}

.control-panel .difficulty-container button.selected {
  background: orange;
}

.control-panel button {
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  background: #2b217b;
  color: #fff;
}

#sound-toggle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: green;
  z-index: 20;
}

#sound-toggle.sound-off {
  background: red;
}

#sound-toggle img {
  width: 60%;        /* scale down the icon */
  height: 60%;
  object-fit: contain;
  display: block;
  margin: auto;
}

#rePlayButton {
  font-weight: bolder;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  position: absolute;
  bottom: 5%;
  font-size: 1.5rem;
  width: 6em;
  height: 6em;
  box-shadow: 0.12rem 0.15rem 0.0005rem -0.019rem rgb(0, 6, 10);
  border-radius: 50%;
  vertical-align: center;
  border: 5px solid rgb(71, 6, 66);
}

#finalScore,
#finalScoreText,
#updateScore {
  /* padding-bottom: 1em; */
  text-align: center;
  position: absolute;
}

#updateScore {
  font-size: 2em;
  width: 97%;
  top: 0.5%;
  /* max-width: 385px; */
  padding: 0;
  background: white;
  color: rgb(89, 12, 233);
  box-shadow: 0 1.5px 2px 1px;
}

#finalScoreText {
  top: 15%;
  font-size: 3em;
}

#finalScore {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  color: rgb(122, 5, 60);
  top: 25%;
  height: 10rem;
  font-size: 8rem;
  min-width: 20%;
  /* max-width: 100px; */

  /* background-clip: content-box; */
}

@media (min-width: 500px) {
  canvas {
    width: 400px;
  }
  #updateScore {
    width: 395px;
  }
}

/* Melody Display Styles - Removed */
/* .melody-display {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.melody-display:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
  transition: all 0.2s ease;
} */

/* Melody change animation - Removed */
/* @keyframes melodyChange {
  0% {
    transform: scale(1);
    background: rgba(0, 0, 0, 0.7);
  }
  50% {
    transform: scale(1.1);
    background: rgba(74, 144, 226, 0.8);
    color: #fff;
  }
  100% {
    transform: scale(1);
    background: rgba(0, 0, 0, 0.7);
  }
} */

/* Mobile responsiveness for melody display - Removed */
/* @media (max-width: 768px) {
  .melody-display {
    top: 10px;
    right: 10px;
    font-size: 12px;
    padding: 6px 10px;
  }
} */

/* Combo Display Styles */
.combo-display {
  position: fixed;
  top: 20px; /* Moved to top position */
  right: 20px;
  background: rgba(74, 144, 226, 0.8);
  color: #fff;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.combo-display.show {
  opacity: 1;
}

/* Combo animation */
@keyframes comboPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.combo-display.pulse {
  animation: comboPulse 0.5s ease;
}

/* Mobile responsiveness for combo display */
@media (max-width: 768px) {
  .combo-display {
    top: 10px;
    right: 10px;
    font-size: 12px;
    padding: 6px 10px;
  }
}
