html {
  height: 100%;
}

/* Page background with animated gradient */
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  background: linear-gradient(-45deg, #ffecd2, #fcb69f, #a18cd1, #fbc2eb);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.top-ui {
  margin-top: 20px;
  text-align: center;
}

.game-title {
  margin: 0 0 8px;
  font-size: 2.5rem;
  color: #000;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.25);
}

.mode-select {
  display: inline-flex;
  gap: 10px;
}

.mode-button {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.mode-button.active {
  background: #ffcc00;
  color: #000;
}



#game-wrapper {
  margin: 10px 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

canvas {
  background-color: #ffffff;
  border: 4px solid #222;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  max-width: 95%;
  height: auto;
}

/* Optional: animated background shift */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

#character-select {
  margin-top: 20px;
  text-align: center;
  color: #fff;
}

#character-select h3 {
  margin-bottom: 12px;
}

.character-grid {
  display: flex;
  flex-wrap: wrap;
  /* ✅ allow wrapping */
  gap: 20px;
  /* ✅ spacing between characters */
  justify-content: center;
  /* ✅ center items horizontally */
  margin-top: 20px;
}

.character-option {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, border 0.2s;
  background-color: rgba(255, 255, 255, 0.3);
}

.character-option:hover {
  transform: scale(1.1);
  border-color: #fff;
}

.character-option.selected {
  border-color: #ff0;
  box-shadow: 0 0 8px rgba(255, 255, 0, 0.8);
}

.character-wrapper {
  width: 100px;
  /* tweak this as needed */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

@media (max-width: 500px) {
  .character-wrapper {
    width: 80px;
    /* shrink size on small screens */
  }

  .character-label {
    font-size: 0.75rem;
  }
}