/* ===================================
   CHARACTER SELECTION MODULE
   =================================== */

.character-selection-container {
  position: relative;
  margin: 0.8rem 0;
  padding: 1.2rem 1rem 1rem;
}

.character-selection-label {
  position: absolute;
  top: -8px;
  left: 12px;
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  color: white;
  background: linear-gradient(145deg, #8b4513, #a0522d, #d2691e);
  padding: 4px 8px;
  border: 2px solid #654321;
  border-radius: 6px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.15),
    inset -1px -1px 2px rgba(0, 0, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.character-selection {
  margin: 0;
}

.character-grid {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.character-box {
  position: relative;
  width: 70px;
  height: 70px;
  /* Wood border effect with transparent background */
  border: 3px solid #654321;
  border-radius: 8px;
  background: transparent;
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.15),
    inset -2px -2px 4px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.character-box.selected,
.character-box.selected:hover {
  border: 4px solid #4caf50 !important;
  background: rgba(76, 175, 80, 0.2) !important;
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.2),
    inset -2px -2px 4px rgba(0, 0, 0, 0.3),
    0 0 12px rgba(76, 175, 80, 0.8),
    0 4px 8px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(-2px) scale(1.05) !important;
}

.character-box.unlocked:hover {
  border-color: #fecf35;
  background: rgba(254, 207, 53, 0.2);
  transform: translateY(-2px);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.25),
    inset -2px -2px 4px rgba(0, 0, 0, 0.3),
    0 0 8px rgba(254, 207, 53, 0.6),
    0 6px 12px rgba(0, 0, 0, 0.4);
}

.character-box.locked {
  opacity: 0.7;
  cursor: pointer;
  border-color: #4a4a4a;
  background: transparent;
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.1),
    inset -2px -2px 4px rgba(0, 0, 0, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
}

.character-box.locked:hover {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.15),
    inset -2px -2px 4px rgba(0, 0, 0, 0.4),
    0 0 12px rgba(255, 215, 0, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.character-sprite {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  animation: boba-bounce 2s ease-in-out infinite;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
}

@keyframes boba-bounce {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}

.lock-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.8rem;
  color: #ffd700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-level {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  font-size: 0.6rem;
  font-weight: bold;
  color: #ffd700;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  padding: 1px 2px;
  line-height: 1;
  z-index: 10;
}

/* Responsive adjustments for character selection */
@media (max-width: 480px) {
  .character-selection-container {
    padding: 1rem 0.6rem 0.8rem;
  }

  .character-selection-label {
    font-size: 7px;
    padding: 3px 6px;
    top: -6px;
    left: 8px;
  }

  .character-box {
    width: 60px;
    height: 60px;
  }

  .character-sprite {
    width: 36px;
    height: 36px;
  }

  .character-grid {
    gap: 0.6rem;
  }

  .lock-icon {
    font-size: 0.7rem;
    width: 14px;
    height: 14px;
  }

  .character-level {
    font-size: 0.5rem;
    bottom: 1px;
    left: 1px;
    right: 1px;
    padding: 0px 1px;
  }
}
